package cn.monkey.chat.server.connect.chat.state.group;

import cn.monkey.state.core.AbstractStateGroup;

import java.util.function.Supplier;

public class ChatGroup extends AbstractStateGroup {

    public ChatGroup(String id,
                     ChatContext stateContext,
                     Supplier<Long> timer) {
        super(id, stateContext, timer);
    }

    @Override
    public ChatContext getStateContext() {
        return (ChatContext) super.getStateContext();
    }

    @Override
    public void flush() {
        /*
        ChatContext stateContext = this.getStateContext();
        ChatMessageRepository chatMessageRepository = stateContext.getChatMessageRepository();
        List<Package> messages = stateContext.getAllMessage();
        chatMessageRepository.saveAll(messages);
         */
    }
}